import re

def clean_text(text):
    # 使用正则表达式去除非中文字符和特殊字符
    cleaned_text = re.sub(r'[^\u4e00-\u9fa5a-zA-Z0-9]+', '', text)
    return cleaned_text

def parse_data(self, res):
    parsed_data = []
    for data in res:
        item = {
            '标题': clean_text(data['title']),
            '视频分类': clean_text(data['tname']),
            'aid': data['aid'],
            'bvid': data['bvid'],
            '视频描述': clean_text(data['desc']),
            '视频封面': data['pic'],
            'up主': clean_text(data['owner']['name']),
            '投币数': data['stat']['coin'],
            '收藏数': data['stat']['favorite'],
            '弹幕数': data['stat']['danmaku'],
            '喜欢数': data['stat']['like'],
            '观看数': data['stat']['view'],
            '分享数': data['stat']['share'],
        }
        parsed_data.append(item)
        print(item)
    return parsed_data
